home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 May / EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso / earcd / dev / amos / blox0_7.lha / bloxbak / bloxbak.amosSourceCode
AMOS Source Code  |  1980-09-18  |  7KB  |  243 lines

  1. Procedure BLOX
  2.  
  3. Screen Open 0,320,256,32,Lowres
  4. Curs Off : Paper 0 : Pen 1 : Cls 0
  5.  
  6. Screen Open 1,320,256,32,Lowres
  7. Curs Off : Paper 0 : Pen 1 : Cls 0
  8.  
  9. Screen 1
  10. Load Iff "red",1
  11.  
  12. Screen Open 2,320,256,32,Lowres
  13. Curs Off : Paper 0 : Pen 1 : Cls 0
  14.  
  15. Screen 2
  16. Load Iff "normal",2
  17.  
  18.  
  19. Screen 0
  20.  
  21. HISCORE=Val(Command Line$)
  22.  
  23. Flash Off 
  24.  
  25. Hide On 
  26.  
  27. Timer=0
  28.  
  29. Goto SKIPSPR
  30.  
  31. Load Iff "1",0
  32.  
  33. For GRABY=0 To 0
  34.    For GRABBER=0 To 9
  35.       Get Bob((GRABBER+1)+(GRABY*32)),(GRABBER*32),(GRABY*32) To((GRABBER*32)+32),((GRABY*32)+32)
  36.       Box(GRABBER*32),(GRABY*32) To((GRABBER*32)+31),((GRABY*32)+31)
  37.    Next GRABBER
  38. Next GRABY
  39.  
  40. Direct 
  41.  
  42. SKIPSPR:
  43.  
  44. Load "bloxsprites.abk",1
  45. Load "samples.abk",2
  46.  
  47. Sam Bank 2
  48.  
  49. No Mask(9)
  50.  
  51. Load Iff "00",0
  52. Repeat 
  53. If Inkey$<>"" Then Fade 1 : Wait 15 : Edit 
  54. JO=Joy(1)
  55. Until JO>15
  56. Fade 1 : Wait 15
  57. 'If JO=8 Then Goto BLOXFULL
  58.  
  59.  
  60. ' *************************************************
  61. ' ******************* free fall *******************
  62. ' *************************************************
  63.  
  64.  
  65. Load Iff "backa",0
  66.  
  67. Randomize(Timer)
  68.  
  69. BLOKNOW=Rnd(7)+1
  70. BLOKNEXT=Rnd(7)+1
  71.  
  72. BLOKX=1
  73. BLOKY=1
  74. BLOKMOVE=1
  75. DROPTIME=1000
  76. SCORE=0
  77.  
  78. Paper 0 : Pen 1
  79. Locate 29,11 : Print SCORE;" "
  80. Locate 29,12 : Print HISCORE;" "
  81.  
  82. Dim BLOKWELL$(4,6)
  83.  
  84. Restore WELLDATA
  85.  
  86. For WELLFEEDY=1 To 6
  87.   For WELLFEEDX=1 To 4
  88.     Read BLOKWELL$(WELLFEEDX,WELLFEEDY)
  89.   Next WELLFEEDX
  90. Next WELLFEEDY
  91.  
  92. WELLDATA:
  93. Data "9","9","9","9"
  94. Data "9","9","9","9"
  95. Data "9","9","9","9"
  96. Data "9","9","9","9"
  97. Data "9","9","9","9"
  98. Data "9","9","9","9"
  99.  
  100. Paste Bob((5*32)+20+65),32,BLOKNEXT
  101.  
  102. Autoback 2
  103. Double Buffer 
  104. TIME=500
  105. SHAKE=1
  106.  
  107. Timer=0
  108. MOVEBLOK:
  109.  A=Joy(1)
  110.  A$=Inkey$
  111.  If A$="s" and SHAKE=1 Then SHAKE=0 : Sam Play 6
  112.  If A$="S" and SHAKE=0 Then SHAKE=1 : Sam Play 6
  113. '   Locate 27,4 : Print DROPTIME;"  "
  114.  If A$="p" Then Gosub PAUSE
  115.  If A$="q" Then SCORE=0 : Fade 1 : Wait 15 : Goto SCORETABLE
  116.  If A=8 and BLOKX<4 Then For BLOKMOVE=((BLOKX*32)+19) To(((BLOKX+1)*32)+19) Step 4 : Wait Vbl : Dec DROPTIME : Bob 1,BLOKMOVE,14,BLOKNOW : Next BLOKMOVE : Inc BLOKX
  117.  If A=4 and BLOKX>1 Then For BLOKMOVE=((BLOKX*32)+19) To(((BLOKX-1)*32)+19) Step -4 : Wait Vbl : Dec DROPTIME : Bob 1,BLOKMOVE,14,BLOKNOW : Next BLOKMOVE : Dec BLOKX
  118.  Bob 1,(BLOKX*32)+19,14,BLOKNOW
  119.  If A>15 Then BLOKY=0 : Gosub DROPBLOK
  120.    Dec DROPTIME
  121.    If DROPTIME<1 Then DROPTIME=0
  122.  
  123.    If TIME<100 Then TIME=100
  124.    If Timer>TIME Then TIME=TIME-5 : Gosub BLOKFALL
  125.  
  126.  Wait Vbl 
  127. Goto MOVEBLOK
  128.  
  129. DROPBLOK:
  130.  
  131.  If BLOKWELL$(BLOKX,BLOKY+1)="9" Then For BLOKMOVE=(14+(BLOKY*32)) To(14+((BLOKY+1)*32)) Step 8 : Bob 1,(BLOKX*32)+19,BLOKMOVE,BLOKNOW : Wait Vbl : Next BLOKMOVE : Inc BLOKY
  132.  If BLOKWELL$(BLOKX,BLOKY+1)="9" Then For BLOKMOVE=(14+(BLOKY*32)) To(14+((BLOKY+1)*32)) Step 8 : Bob 1,(BLOKX*32)+19,BLOKMOVE,BLOKNOW : Wait Vbl : Next BLOKMOVE : Inc BLOKY
  133.  If BLOKWELL$(BLOKX,BLOKY+1)="9" Then For BLOKMOVE=(14+(BLOKY*32)) To(14+((BLOKY+1)*32)) Step 8 : Bob 1,(BLOKX*32)+19,BLOKMOVE,BLOKNOW : Wait Vbl : Next BLOKMOVE : Inc BLOKY
  134.  If BLOKWELL$(BLOKX,BLOKY+1)="9" Then For BLOKMOVE=(14+(BLOKY*32)) To(14+((BLOKY+1)*32)) Step 8 : Bob 1,(BLOKX*32)+19,BLOKMOVE,BLOKNOW : Wait Vbl : Next BLOKMOVE : Inc BLOKY
  135.  If BLOKWELL$(BLOKX,BLOKY+1)="9" Then For BLOKMOVE=(14+(BLOKY*32)) To(14+((BLOKY+1)*32)) Step 8 : Bob 1,(BLOKX*32)+19,BLOKMOVE,BLOKNOW : Wait Vbl : Next BLOKMOVE : Inc BLOKY
  136.  If BLOKWELL$(BLOKX,BLOKY+1)="9" Then For BLOKMOVE=(14+(BLOKY*32)) To(14+((BLOKY+1)*32)) Step 8 : Bob 1,(BLOKX*32)+19,BLOKMOVE,BLOKNOW : Wait Vbl : Next BLOKMOVE : Inc BLOKY
  137.  Sam Play 1
  138.  
  139.  Gosub SS
  140.  
  141.  Paste Bob(19+(BLOKX*32)),(14+(BLOKY*32)),BLOKNOW
  142.  BLOKWELL$(BLOKX,BLOKY)=Str$(BLOKNOW)
  143.   If BLOKX=1 Then Goto SKIPLEFTCHECK
  144.   If BLOKWELL$(BLOKX-1,BLOKY)=Str$(BLOKNOW) Then Sam Play 15 : Gosub SCOREADD : Gosub HITLEFT
  145.  SKIPLEFTCHECK:
  146.   If BLOKX=4 Then Goto SKIPRIGHTCHECK
  147.   If BLOKWELL$(BLOKX+1,BLOKY)=Str$(BLOKNOW) Then Sam Play 15 : Gosub SCOREADD : Gosub HITRIGHT
  148.  SKIPRIGHTCHECK:
  149.  If BLOKY=6 Then Goto SKIPDOWNCHECK
  150.  If BLOKWELL$(BLOKX,BLOKY+1)=Str$(BLOKNOW) Then Sam Play 15 : Gosub SCOREADD : BLOKWELL$(BLOKX,BLOKY+1)="9" : BLOKWELL$(BLOKX,BLOKY)="9" : Paste Bob(BLOKX*32)+19,((BLOKY+1)*32)+14,9 : Paste Bob((BLOKX)*32)+19,((BLOKY)*32)+14,9 : Wait Vbl : BLOKY=0
  151.  SKIPDOWNCHECK:
  152.   If BLOKY=1 Then Fade 1 : Wait 15 : Goto SCORETABLE
  153.  BLOKNOW=BLOKNEXT : BLOKNEXT=Rnd(7)+1
  154.  
  155. Paste Bob((5*32)+20+65),32,BLOKNEXT
  156.  DROPTIME=(1000-(SCORE/1000))
  157. Return 
  158.  
  159. SCOREADD:
  160. Wait Vbl 
  161. SCORE=SCORE+((DROPTIME/10)*100)
  162. If SCORE>HISCORE Then HISCORE=SCORE
  163. Locate 29,11 : Print SCORE;" "
  164. Locate 29,12 : Print HISCORE;" "
  165. DROPTIME=(1000-(SCORE/1000))
  166. Wait Vbl 
  167. Return 
  168.  
  169. HITLEFT:
  170. BLOKWELL$(BLOKX,BLOKY)="9" : BLOKWELL$(BLOKX-1,BLOKY)="9" : Paste Bob(BLOKX*32)+19,((BLOKY)*32)+14,9 : Paste Bob((BLOKX-1)*32)+19,(BLOKY*32)+14,9
  171. Wait 5
  172. Return 
  173.  
  174. HITRIGHT:
  175. BLOKWELL$(BLOKX,BLOKY)="9" : BLOKWELL$(BLOKX+1,BLOKY)="9" : Paste Bob(BLOKX*32)+19,((BLOKY)*32)+14,9 : Paste Bob((BLOKX+1)*32)+19,(BLOKY*32)+14,9
  176. Wait 5
  177. Return 
  178.  
  179. SCORETABLE:
  180. Command Line$=Str$(SCORE)
  181. Run "score"
  182.  
  183. BLOKFALL:
  184.  BLOKY2=0
  185.  BLOKN=Rnd(7)+1
  186. CFALL:
  187.  BLOKX2=Rnd(3)+1
  188.  If BLOKX2=BLOKX Then Goto CFALL
  189.  
  190.  If BLOKWELL$(BLOKX2,BLOKY2+2)<>"9" Then Return 
  191.  If BLOKWELL$(BLOKX2,BLOKY2+1)="9" Then For BLOKMOVE=(14+(BLOKY2*32)) To(14+((BLOKY2+1)*32)) Step 8 : Bob 4,(BLOKX2*32)+19,BLOKMOVE,BLOKN : Wait Vbl : Next BLOKMOVE : Inc BLOKY2
  192.  If BLOKWELL$(BLOKX2,BLOKY2+1)="9" Then For BLOKMOVE=(14+(BLOKY2*32)) To(14+((BLOKY2+1)*32)) Step 8 : Bob 4,(BLOKX2*32)+19,BLOKMOVE,BLOKN : Wait Vbl : Next BLOKMOVE : Inc BLOKY2
  193.  If BLOKWELL$(BLOKX2,BLOKY2+1)="9" Then For BLOKMOVE=(14+(BLOKY2*32)) To(14+((BLOKY2+1)*32)) Step 8 : Bob 4,(BLOKX2*32)+19,BLOKMOVE,BLOKN : Wait Vbl : Next BLOKMOVE : Inc BLOKY2
  194.  If BLOKWELL$(BLOKX2,BLOKY2+1)="9" Then For BLOKMOVE=(14+(BLOKY2*32)) To(14+((BLOKY2+1)*32)) Step 8 : Bob 4,(BLOKX2*32)+19,BLOKMOVE,BLOKN : Wait Vbl : Next BLOKMOVE : Inc BLOKY2
  195.  If BLOKWELL$(BLOKX2,BLOKY2+1)="9" Then For BLOKMOVE=(14+(BLOKY2*32)) To(14+((BLOKY2+1)*32)) Step 8 : Bob 4,(BLOKX2*32)+19,BLOKMOVE,BLOKN : Wait Vbl : Next BLOKMOVE : Inc BLOKY2
  196.  If BLOKWELL$(BLOKX2,BLOKY2+1)="9" Then For BLOKMOVE=(14+(BLOKY2*32)) To(14+((BLOKY2+1)*32)) Step 8 : Bob 4,(BLOKX2*32)+19,BLOKMOVE,BLOKN : Wait Vbl : Next BLOKMOVE : Inc BLOKY2
  197. Sam Play 2
  198. Gosub SS
  199. Paste Bob(19+(BLOKX2*32)),(14+(BLOKY2*32)),BLOKN : Bob Off 4
  200.  BLOKWELL$(BLOKX2,BLOKY2)=Str$(BLOKN)
  201.  
  202.  Wait Vbl 
  203.  
  204. Timer=0
  205.  
  206. Return 
  207.  
  208. PAUSE:
  209. Fade 1 To 1
  210. Wait 15
  211. PAUSETIME=Timer
  212. Clear Key 
  213. Sam Play 14
  214. Wait 10
  215. PAUSE2:
  216. A=Joy(1)
  217. If A<1 Then Goto PAUSE2
  218. Sam Play 14
  219. A=0
  220. Fade 1 To 2
  221. Wait 15
  222. Timer=PAUSETIME
  223. Return 
  224.  
  225. SS:
  226. If SHAKE=0 Then Return 
  227. Screen Display 0,128,46,320,256
  228. Wait Vbl 
  229. Screen Display 0,128,43,320,256
  230. Wait Vbl 
  231. Screen Display 0,128,44,320,256
  232. Wait Vbl 
  233. Return 
  234.  
  235. BLOXFULL:
  236.  
  237. End Proc
  238. BLOX
  239. '
  240. ' blox - version 0.7 unregistered
  241. '  
  242. ' al carroll 1997  
  243. '